package com.example.socket.util;

import com.example.socket.ServletConstant;

/**
 * @Classname ServletStrUtils
 * @Description TODO
 * @Date 2023/4/28 9:46
 * @Created by XiongXiong
 * @Author: X.I.O
 *
 * 字符串转码工具
 */
public class ServletStrUtils {

    public static String getString(String str){
        if(str==null || "".equals(str)){
            return "";
        }
        try {
           return new String (str.getBytes (ServletConstant.BYTE_CODE),ServletConstant.STRING_CODE);
        }catch (Exception e){
            e.printStackTrace();
        }
        return "";
    }
}
